﻿using System;
using System.Collections.Generic;
using System.Text;
using NLBS.Entity;
using NLBS.Framework;

namespace NLBS.Data.Business
{
  public class TrackBackFacade
    {
        private TrackBack tb;
        public TrackBackFacade(TrackBack tb, bool addordelete)
        {
            this.tb = tb;
            UpdateWhenDeleteInsert(addordelete);
        }

        public void UpdateWhenDeleteInsert(bool addordelete)
        {
            int count=1;
            if (!addordelete)
                count = -1;
            Article art = ArticleData.GetArticleByID(tb.LogID);
            art.TrackBackCount+=count;
            BlogInfo.Instance().PingTrackCount += count;
        }
    }
}
